package com.weaver.drools.business.drools.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.weaver.drools.business.drools.service.IPersonService;
import com.weaver.drools.common.dao.PersonDao;
import com.weaver.drools.common.entity.Person;

/**
 *  @application name: 
 *  @author: zhouxinlei 
 *  @time：2018年10月8日
 *  @version：ver 1.1
 */
@Service
public class PersonServiceImpl implements IPersonService {
	
	@Resource
	private PersonDao personDao;
	
	public void deletePerson(Long Id) {
		personDao.deleteById(Id);
		
	}
	
	public Person savePerson(Person person) {
		personDao.save(person);
		return person;
	}

	public Person updatePerson(Person person) {
		personDao.save(person);
		return person;
	}
	public List<Person> findPersonList() {
		List<Person> list = personDao.findAll();
		return list;
	}

	public Person findPersonInfo(Long Id) {
		Person person = personDao.findPersonById(Id);
		return person;
	}

}
